hackerrank ruby array selection solution

join shbcf.ru